package cn.jnetty.api;

import cn.jnetty.api.annotation.JComponent;
import cn.jnetty.api.annotation.JValue;

/**
 * @author 猪哥亮
 * @email 1030681978@qq.com
 * @date 2020/4/6 17:47
 * 描述：
 */
@JComponent
public class JnettyProperties {
    /**端口*/
    @JValue("jnetty.socket.tcpPort")
    private int tcpPort = 8080;
    /**端口*/
    @JValue("jnetty.socket.httpPort")
    private int httpPort = 8081;
    /**端口*/
    @JValue("jnetty.socket.udpPort")
    private int udpPort = 8082;
    /**端口*/
    @JValue("jnetty.socket.websocketPort")
    private int websocketPort = 8083;
    /** 向内部提供HTTP服务的最大内容长度（默认：1048576=1M） */
    @JValue("jnetty.socket.maxContentLength")
    private int maxContentLength = 1048576;
    /**创建的线程池昵称*/
    @JValue("jnetty.socket.threadFactoryName")
    private String threadFactoryName = "jnetty-io-";
    /**boss线程数量默认0则油netty自动分配*/
    @JValue("jnetty.socket.bossGroup")
    private int bossGroup = 0;
    /**work线程数量默认0则油netty自动分配*/
    @JValue("jnetty.socket.workerGroup")
    private int workerGroup = 0;
    /**Socket参数，服务端接受连接的队列长度，如果队列已满，客户端连接将被拒绝。默认值，Windows为200，其他为128。*/
    @JValue("jnetty.socket.optionLength")
    private int optionLength = 128;
    /**关闭服务器最大延迟多少秒 默认1秒*/
    @JValue("jnetty.socket.shutdownMaxTime")
    private int shutdownMaxTime = 1;
    /** Netty低水位，默认值32K */
    @JValue("jnetty.socket.defaultLowWaterMark")
    private int defaultLowWaterMark = 32 * 1024;
    /** Netty高水位，默认值64K */
    @JValue("jnetty.socket.defaultHighWaterMark")
    private int defaultHighWaterMark = 64 * 1024;
    /** 向内部提供HTTP服务的最大内容长度（默认：1048576=1M） */
    @JValue("jnetty.socket.heartbeat")
    private int heartbeat = 0;
    @JValue("jnetty.socket.logActive")
    private boolean logActive = false;
    @JValue("jnetty.socket.serverType")
    private String serverType = "jnetty-tcp-";

    public String getServerType() {
        return serverType;
    }

    public void setServerType(String serverType) {
        this.serverType = serverType;
    }

    public int getTcpPort() {
        return tcpPort;
    }

    public void setTcpPort(int tcpPort) {
        this.tcpPort = tcpPort;
    }

    public int getHttpPort() {
        return httpPort;
    }

    public void setHttpPort(int httpPort) {
        this.httpPort = httpPort;
    }

    public int getUdpPort() {
        return udpPort;
    }

    public void setUdpPort(int udpPort) {
        this.udpPort = udpPort;
    }

    public int getWebsocketPort() {
        return websocketPort;
    }

    public void setWebsocketPort(int websocketPort) {
        this.websocketPort = websocketPort;
    }

    public int getMaxContentLength() {
        return maxContentLength;
    }

    public void setMaxContentLength(int maxContentLength) {
        this.maxContentLength = maxContentLength;
    }

    public String getThreadFactoryName() {
        return threadFactoryName;
    }

    public void setThreadFactoryName(String threadFactoryName) {
        this.threadFactoryName = threadFactoryName;
    }

    public int getBossGroup() {
        return bossGroup;
    }

    public void setBossGroup(int bossGroup) {
        this.bossGroup = bossGroup;
    }

    public int getWorkerGroup() {
        return workerGroup;
    }

    public void setWorkerGroup(int workerGroup) {
        this.workerGroup = workerGroup;
    }

    public int getOptionLength() {
        return optionLength;
    }

    public void setOptionLength(int optionLength) {
        this.optionLength = optionLength;
    }

    public int getShutdownMaxTime() {
        return shutdownMaxTime;
    }

    public void setShutdownMaxTime(int shutdownMaxTime) {
        this.shutdownMaxTime = shutdownMaxTime;
    }

    public int getDefaultLowWaterMark() {
        return defaultLowWaterMark;
    }

    public void setDefaultLowWaterMark(int defaultLowWaterMark) {
        this.defaultLowWaterMark = defaultLowWaterMark;
    }

    public int getDefaultHighWaterMark() {
        return defaultHighWaterMark;
    }

    public void setDefaultHighWaterMark(int defaultHighWaterMark) {
        this.defaultHighWaterMark = defaultHighWaterMark;
    }

    public int getHeartbeat() {
        return heartbeat;
    }

    public void setHeartbeat(int heartbeat) {
        this.heartbeat = heartbeat;
    }

    public boolean isLogActive() {
        return logActive;
    }

    public void setLogActive(boolean logActive) {
        this.logActive = logActive;
    }
}
